apiVersion: v1
kind: Pod
metadata:
  annotations: {}
  labels:
    k8s.kuboard.cn/name: kuboard-v3
  name: kuboard-v3
  namespace: kuboard
spec:
  containers:
    - env:
        - name: KUBOARD_ENDPOINT
          value: "http://{{ ip }}:{{ kuboard_port }}"
        - name: KUBOARD_AGENT_SERVER_TCP_PORT
          value: "10081"
      image: 'eipwork/kuboard:{{ kuboard_version }}'
      imagePullPolicy: IfNotPresent
      livenessProbe:
        failureThreshold: 3
        httpGet:
          path: /kuboard-resources/version.json
          port: 80
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      name: kuboard
      ports:
        - containerPort: 80
          hostPort: {{ kuboard_port }}
          name: web
          protocol: TCP
        - containerPort: 10081
          name: peer
          protocol: TCP
          hostPort: 10081
        - containerPort: 10081
          name: peer-u
          protocol: UDP
          hostPort: 10081
      readinessProbe:
        failureThreshold: 3
        httpGet:
          path: /kuboard-resources/version.json
          port: 80
          scheme: HTTP
        initialDelaySeconds: 30
        periodSeconds: 10
        successThreshold: 1
        timeoutSeconds: 1
      volumeMounts:
        - mountPath: /data
          name: data
        - mountPath: /init-etcd-scripts/import-cluster-once.yaml
          name: import-cluster-yaml
  volumes:
    - hostPath:
        path: "{{ kuboard_data_dir }}"
      name: data
    - hostPath:
        path: "{{ kuboard_data_dir }}/import-cluster-once.yaml"
      name: import-cluster-yaml
  dnsPolicy: ClusterFirst
  restartPolicy: Always
  tolerations:
    - key: node-role.kubernetes.io/master
      operator: Exists
